package com.example.demo.service;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Random;

public class randomDataService {
    //生成1-7随机数
    public int randoNumber() {
        int[] arr = {1, 2, 3, 4, 5, 2, 1, 2, 1, 2};
        int index = (int) (Math.random() * arr.length);
        int rand = arr[index];

        return rand;
    }

    public int randoNumbera() {
        int[] arr = {2, 3};
        int index = (int) (Math.random() * arr.length);
        int rand = arr[index];

        return rand;
    }

    public int randoNumberb() {
        int[] arr = {2, 2, 3};
        int index = (int) (Math.random() * arr.length);
        int rand = arr[index];

        return rand;
    }

    //随机生成一个100以内的数字
    public int scounta() {
        Random r = new Random();
        return r.nextInt(7);
    }

    //随机生成一个100以内的数字
    public int scountfive() {
        Random r = new Random();
        return r.nextInt(6);
    }

    //随机生成一个1000以内的数字
    public int scountb() {
        Random r = new Random();
        return r.nextInt(1000000);
    }

    //来源平台名称
    public String scountc() {
        String[] arrAppName = {"DH", "WZ", "AP", "WX", "YJ", "WB", "DX"};
        int AppNamea = (int) (Math.random() * arrAppName.length);
        return arrAppName[AppNamea];
    }

    //行政区域编码
    public String scountd() {
        String[] arrRegionIds = {"52", "53", "54", "55", "56", "57"};
        int RegionIdsa = (int) (Math.random() * arrRegionIds.length);
        return arrRegionIds[RegionIdsa];
    }

    //部门
    public String scounte() {
        String[] arrRegionIds = {"100001", "100002", "100003", "100004", "100001"};
        int RegionIdsa = (int) (Math.random() * arrRegionIds.length);
        return arrRegionIds[RegionIdsa];
    }

    //操作意见
    public String scountf() {
        String[] arrRegionIds = {"无意见", "办事效率太慢"};
        int RegionIdsa = (int) (Math.random() * arrRegionIds.length);
        return arrRegionIds[RegionIdsa];
    }

    //办理情况
    public String scountg() {
        String[] arrRegionIds = {"已办理", "未办理"};
        int RegionIdsa = (int) (Math.random() * arrRegionIds.length);
        return arrRegionIds[RegionIdsa];
    }

    //办理情况
    public String scounth() {
        String[] arrRegionIds = {"反馈", "记录回访", "短信回访"};
        int RegionIdsa = (int) (Math.random() * arrRegionIds.length);
        return arrRegionIds[RegionIdsa];
    }

    //回访结果
    public String scounti() {
        String[] arrRegionIds = {"10", "20", "30"};
        int RegionIdsa = (int) (Math.random() * arrRegionIds.length);
        return arrRegionIds[RegionIdsa];
    }

    //回访结果满意度
    public String scountk() {
        String[] arrRegionIds = {"10", "20", "30"};
        int RegionIdsa = (int) (Math.random() * arrRegionIds.length);
        return arrRegionIds[RegionIdsa];
    }

    //使命性别
    public String scountl() {
        String[] arrRegionIds = {"1", "2", "0"};
        int RegionIdsa = (int) (Math.random() * arrRegionIds.length);
        return arrRegionIds[RegionIdsa];
    }


    //返回电话号码
    public static int getNum(int start, int end) {
        return (int) (Math.random() * (end - start + 1) + start);
    }

    private static String[] telFirst = "134,135,136,137,138,139,150,151,152,157,158,159,130,131,132,155,156,133,153".split(",");

    public String phone() {
        int index = getNum(0, telFirst.length - 1);
        String first = telFirst[index];
        String second = String.valueOf(getNum(1, 888) + 10000).substring(1);
        String third = String.valueOf(getNum(1, 9100) + 10000).substring(1);
        return first + second + third;
    }

    //电话接通率
    public double scountp() {
        int[] arrTalkedRate = {7, 8, 9};
        int[] arrTalkedRats = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};

        int talkedRatea1 = (int) (Math.random() * arrTalkedRate.length);
        int talkedRatea2 = (int) (Math.random() * arrTalkedRats.length);
        int talkedRatea3 = (int) (Math.random() * arrTalkedRats.length);

        String a = String.valueOf(arrTalkedRate[talkedRatea1]);
        String b = String.valueOf(arrTalkedRats[talkedRatea2]);
        String c = String.valueOf(arrTalkedRats[talkedRatea3]);

        StringBuffer sb = new StringBuffer();

        sb.append(a);
        sb.append(b);
        sb.append(".");
        sb.append(c);

        double as = Double.valueOf(sb.toString());

        return as;
    }

    //获取当前时间
    public String currentDate() {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return df.format(new Date());
    }

    //经度
    public String lng() {
        String[] arrTalkedRate = {"116.397128", "117.21286286328123", "116.83932770703123", "117.09750641796873"};
        int talkedRatea = (int) (Math.random() * arrTalkedRate.length);
        return arrTalkedRate[talkedRatea];
    }

    //纬度
    public String lat() {
        String[] arrTalkedRate = {"39.916527", "39.079384509641365", "38.30766214205858", "36.20931827952499"};
        int talkedRatea = (int) (Math.random() * arrTalkedRate.length);
        return arrTalkedRate[talkedRatea];
    }

    //是否保密
    public String isSecrecy() {
        String[] arrTalkedRate = {"是", "否"};
        int talkedRatea = (int) (Math.random() * arrTalkedRate.length);
        return arrTalkedRate[talkedRatea];
    }

    //咨询,投诉,求助,催促,回复,骚扰,增援,多转,撤销,报装',
    //工单类型
    public String payrollType() {
        String[] arrTalkedRate = {"咨询", "投诉", "求助", "催促", "回复", "骚扰", "增援", "多转", "撤销", "报装"};
        //"投诉", "举报",
        int talkedRatea = (int) (Math.random() * arrTalkedRate.length);
        return arrTalkedRate[talkedRatea];
    }

    //重要程度
    public String degree() {
        String[] arrTalkedRate = {"一般", "重要", "非常重要"};
        int talkedRatea = (int) (Math.random() * arrTalkedRate.length);
        return arrTalkedRate[talkedRatea];
    }

    //办理类型
    public String handleType() {
        String[] arrTalkedRate = {"转办", "直办", "直办", "直办"};
        int talkedRatea = (int) (Math.random() * arrTalkedRate.length);
        return arrTalkedRate[talkedRatea];
    }

    //案件来源
    public String srcWay() {
        String[] arrTalkedRate = {"电话"};
        int talkedRatea = (int) (Math.random() * arrTalkedRate.length);
        return arrTalkedRate[talkedRatea];
    }

    //诉求内容
    public String rollontent() {
        String[] arrTalkedRate = {"工地施工太吵"
                , "文化路路树倒了"
                , "科学大道路边电线杆漏电"
                , "房子烂尾，开发商跑路，房钱无法追回"
                , "xx道路结冰，多名行人摔伤", "7月14日早10点15左右在自行车道行走罚20，行人本人对行为及罚款本身无异议，但请相关方也来实地了解下行人的困难！在每日早晨8点至9点前往此处车站(长江西路共和新路站医院门口查看下)，尤其是找个下雨天，地铁站医院门口这段路非常窄，有2个人走后面人就过不去，边上全都停的车，再来下雨天撑伞，只能走一人，加上对向人推车这条路直接堵死，有宽一点的人行上阶沿，没人愿意和自行车挤车道，这一点在之前就已经打12345，无奈现在很难打通，希望相关方面发生的现象先找原因，先方便市民出行好嘛，这个闯红灯是2码事了"
                , "沪翔高速地上的坑坑洼洼至少30+，一下大雨就会出现塌陷和开裂等情况，维修车几乎每周可见，而且都是在上下班时段，人为制造拥堵但高速质量却未见明显提升，真的是可谓造高速养活一批企业，反复修高速继续养活另一批企业"
                , "我们是都市路沿线小区的居民，S4金都路北上匝道是我们到徐汇区的一个入口，如果取消，下一个入口就是春申路了，而且上下班时都市路非常堵，所以我们希望保留s4金都路北匝道？？"
                , "地面不平卡车开过声音很大"
                , "一、污损纸张如何定义\n" +
                "与其他垃圾混合过的打印纸是否还可回收，碎纸片和碎纸屑是否可回收。\n" +
                "\n" +
                "二、塑料是可回收物\n" +
                "\n" +
                "塑料袋是其他垃圾，那么都哪些塑料是可回收物？\n" +
                "\n" +
                "三、大棒骨属于其他垃圾\n" +
                "\n" +
                "排骨，鸡骨头是不是厨余垃圾？多大的骨头算其他垃圾？医学用头盖骨属于什么垃圾？"
                , "xx小区地下车库进水"
                , "文化路路树倒了"};
        int talkedRatea = (int) (Math.random() * arrTalkedRate.length);
        return arrTalkedRate[talkedRatea];
    }

    //年龄
    public String age() {
        String[] arrTalkedRate = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
        int agea = (int) (Math.random() * arrTalkedRate.length);
        int ageb = (int) (Math.random() * arrTalkedRate.length);
        String agec = arrTalkedRate[agea] + arrTalkedRate[ageb];
        return agec;
    }

    //年龄
    public String ages() {
        String[] arrTalkedRate = {"10", "20", "30", "40", "70"};
        int agea = (int) (Math.random() * arrTalkedRate.length);
        String agec = arrTalkedRate[agea];
        return agec;
    }

    //诉求标题
    public String payrollTitle() {
        String[] arrTalkedRate = {"aaa", "bbb", "道路整治规范罚款", "沪翔高速S6豆腐渣工程", "天然气泄漏", "燃气管爆炸", "图书馆着火", "科学大道堵车", "房屋侵权", "房子无法交付", "小区断水", "小区断电", "拖欠工资"
                , "垃圾分类细化分类问题", "房子质量问题", "地面不平卡车开过声音很大", "线路安全问题", "保留S4金都路北匝道"};
        int talkedRatea = (int) (Math.random() * arrTalkedRate.length);
        return arrTalkedRate[talkedRatea];
    }

    //转办形式
    public String distributeWay() {
        String[] arrTalkedRate = {"直接转办", "bbb"};
        int talkedRatea = (int) (Math.random() * arrTalkedRate.length);
        return arrTalkedRate[talkedRatea];
    }

    //操作阶段
    public String psCaption() {
        String[] arrTalkedRate = {"111", "222"};
        int talkedRatea = (int) (Math.random() * arrTalkedRate.length);
        return arrTalkedRate[talkedRatea];
    }

    //是否
    public String yesNo() {
        String[] arrTalkedRate = {"是", "否"};
        int talkedRatea = (int) (Math.random() * arrTalkedRate.length);
        return arrTalkedRate[talkedRatea];
    }

    //情绪
    public String emotion() {
        String[] arrTalkedRate = {"激情", "激动", "害怕"};
        int talkedRatea = (int) (Math.random() * arrTalkedRate.length);
        return arrTalkedRate[talkedRatea];
    }

    //社区
    public String community() {
        String[] arrTalkedRate = {"太上小区", "月亮湾小区"};
        int talkedRatea = (int) (Math.random() * arrTalkedRate.length);
        return arrTalkedRate[talkedRatea];
    }

    //道路
    public String street() {
        String[] arrTalkedRate = {"泉中路", "桃南东路"};
        int talkedRatea = (int) (Math.random() * arrTalkedRate.length);
        return arrTalkedRate[talkedRatea];
    }

    //编号
    public String job() {
        String[] arrTalkedRate = {"100011", "100012", "100013", "100014", "100015", "100016", "100017", "100018", "100019", "100020"};
        int talkedRatea = (int) (Math.random() * arrTalkedRate.length);
        return arrTalkedRate[talkedRatea];
    }

    //作息状态
    public String state() {
        String[] arrTalkedRate = {"在线", "繁忙", "迁出"};
        int talkedRatea = (int) (Math.random() * arrTalkedRate.length);
        return arrTalkedRate[talkedRatea];
    }

    //回访结果满意度
    public String manyi() {
        String[] arr = {"10", "20", "30"};
        int index = (int) (Math.random() * arr.length);
        String rand = arr[index];

        return rand;
    }

    //工单当前状态-工单类型
    public String orderState() {
        //已保存,已提交,已转办,办理中,已回复(办理中),已回访(未办结),已回复(处理完),已核查,已回访(已办结),直办
        String[] arr = {"已保存", "已提交", "已转办", "办理中", "已回复(办理中)", "已回访(未办结)", "已回复(处理完)", "已核查", "已回访(已办结)", "直办", "直办", "直办", "已回访(已办结)", "已回访(已办结)"};
        int index = (int) (Math.random() * arr.length);
        return arr[index];

    }

    //诉求类型
    public String suqiu() {
        String[] arr = {"10", "15", "30", "20", "35", "25"};
        int index = (int) (Math.random() * arr.length);
        String rand = arr[index];

        return rand;
    }

    //随机生成一个随机数
    public int suiji1() {
        int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};
        int index = (int) (Math.random() * arr.length);
        int rand = arr[index];

        return rand;
    }

    //是否
    public String shifou() {
        String[] arr = {"是", "否", "否", "否", "否"};
        int index = (int) (Math.random() * arr.length);
        String rand = arr[index];
        return rand;
    }

    //获取当前时间
    public String starttimes() {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
//        System.out.println(df.format(new Date()));
        String s = df.format(new Date());
        return s;
    }

    public String endtime() {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        Calendar c = new GregorianCalendar();

        Date date = new Date();

        c.setTime(date);
        c.add(Calendar.SECOND, +30);
        Date time = c.getTime();
        String format = df.format(time);
        return format;
    }

    //满意、不满意
    public String manyis() {

        String[] arr = {"满意", "满意", "满意", "满意", "满意", "满意", "满意", "不满意"};
        int index = (int) (Math.random() * arr.length);
        String rand = arr[index];
        return rand;
    }


}
